Example 7: Update records

In this example the Import tool is used to update records in Vitalware. Updating records only requires that a unique field (or combination of unique fields) is used to identify an existing record. Another way of expressing this is that if a unique field (or combination of unique fields) is present in the Import data file and there is a matching record, the matching record will be updated rather than a new record being created.

Uniqueness is determined by a combination of two conditions. Both must be met:

  1. The field must be specified as unique in the back-end.

    Every module has at least one field that is specified as unique in the back-end by default: IRN.

    In versions of Vitalware prior to Vitalware 2.3, defining a field as unique was done in the back-end, typically by Vitalware's developers. Contact Axiell Support for details.

    From Vitalware 2.3 onwards: the Unique attribute can be set using the Unique Index Indexing Registry entry.

  2. The Unique Strict Registry entry must be specified for each of these unique fields (except for IRN).

    Unique Strict specifies whether a field should be checked for uniqueness as a new record is being processed or existing record is being edited. Typically the check occurs as a field is exited (displaying a warning if it is a duplicate), but in the case of the Import Tool, as each record is being processed.

    Note: For multi-column unique values (where a combination of fields is used to specify uniqueness) it is necessary to set Unique in the back-end and specify Unique Strict in the Registry for each of the fields.

This example uses IRN as well as Accession Number to identify records in the Births module and update a located record's System Alerts fields: if unique fields are specified in the data file and a matching record is identified in Vitalware, the Vitalware record is updated.

Note that if a record with a unique field specified in the data file does not exist in Vitalware, it will be created.

Note: Unique fields cannot themselves be updated.

Rules

  1. If a single record in the data file matches a record in Vitalware using a field or fields configured in Vitalware to be unique (e.g. an IRN), the record is updated.
  2. If a record in the data file includes a field or fields configured in Vitalware to be unique (e.g. an IRN) and it does not match a record in Vitalware or there is more than one match, a new record is created.

In this example the fields used are:

Fields

Back-end name

IRN irn
System Notes SysNotes